package com.hs.wa.uilt;

import org.apache.log4j.Logger;

import java.text.DecimalFormat;

public class SpringUilts {

    private static final Logger logger = Logger.getLogger(SpringUilts.class);

    //复制对象
    public static void copyProperties(Object source, Object target) {
        org.springframework.beans.BeanUtils.copyProperties(source, target);
    }

    //转换精度小数点后三位四舍五入
    public static String DoubleValue(Object target) {
        DecimalFormat format = new DecimalFormat("0.00");
        String d = format.format(target);
        logger.info("转换精度后的值： '" + d + "'");
        System.out.println("转换精度后的值： '" + d + "'");
        return d;

    }

}
